<%@ page import="java.sql.*,studentportal.*"%>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>

<body background="indtextb.jpg" bgcolor="#FFFFFF" text="#000000" link="#3366CC" vlink="#666666" alink="#996600">

<!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><!--mstheme--></font>

<table border="0" width="100%">
  <tr>
    <td width="100%"><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><img border="0" src="StdPrtlbanner.jpg" width="846" height="65">&nbsp;<!--mstheme--></font></td>
  </tr>
</table>
<!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><!--mstheme--></font>
<table border="0" width="100%">
  <tr>
    <td width="23%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminAdmissionHome.html">Admissions</a><!--mstheme--></font></td>
    <td width="23%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminStudentHome.html">Students</a><!--mstheme--></font></td>
    <td width="23%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminFacultyHome.html">Faculties</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminNotificaiton.jsp">Notifications</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminExamHome.html">Examination</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminBranchHome.html">Branches</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminBooksHome.html">Books</a><!--mstheme--></font></td>
    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminCourseHome.html">Courses</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminSemesterHome.html">Semesters</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminSubjectHome.html">Subjects</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><a href="AdminDesignationHome.html">Designation</a><!--mstheme--></font></td>

	  <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="Home.html">Home</a><!--mstheme--></font></td>
  </tr>
</table>
<br><br><br>
<!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">

<p align="center">&nbsp;</p>
<form method="POST" action="./AdminExamServlet">
  <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
  S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
  <div align="center">
    <center>
    <table border="1" width="49%" bordercolor="#0000FF">
      <tr>
        <td width="100%" colspan="2" style="font-size: 14pt; font-weight: bold; color: #0000FF">
          <p align="center">Examination Information</td>
      </tr>
      <tr>
        <td width="50%">Exam ID</td>
        <td width="50%"><select size="1" name="eid" tabindex="1">
          <%
					System.out.println("ss");
					Connection con=MySQLDriver.getConnection(); 
					Statement st=con.createStatement();
					System.out.println("After Statement");
					ResultSet rs=st.executeQuery("select max(examination_id) from examination_master");
					System.out.println("rs is "+rs);
					int id=999;
					String str1=null,str2=null;
					if(rs.next()) {
							str1=rs.getString(1);
					} else {
							str1=null;
					}
					System.out.println(str1);
					if(str1!=null) {	
						str2=str1.substring(3);
						System.out.println(str2);
						id=Integer.parseInt(str2);
					}
						id++;
										
						st.close();
						con.close();
						//rs.close();
		%>
		<option><%="EXM"+id%></option>
        </select></td>
      </tr>
      <tr>
        <td width="50%">Exam Name</td>
        <td width="50%"><input type="text" name="ename" size="20" tabindex="2"></td>
      </tr>
	  <tr>
        <td width="50%">Exam Type</td>
		 <td width="50%"><select size="1" name="etype" tabindex="3">
			<option>SEMESTER</option>
			<option>YEAR</option>
		</select></td>
        
      </tr>
      <tr>
      <tr>
        <td width="50%">Course ID</td>
        <td width="50%"><select size="1" name="cid" tabindex="3">
		<%
					System.out.println("ss");
					Connection con1=MySQLDriver.getConnection(); 
					Statement st1=con1.createStatement();
					System.out.println("After Statement");
					ResultSet rs1=st1.executeQuery("select * from course_master");
					while(rs1.next())
					{
		%>
						<option value="<%=rs1.getString(1)%>"><%=rs1.getString(2)%></option>
		<%
					}
					st1.close();
					con1.close();
		%>
          </select></td>
      </tr>
      <tr>
        <td width="50%">Semester ID</td>
        <td width="50%"><select size="1" name="semid" tabindex="4">
		<%
					System.out.println("ss");
					Connection con2=MySQLDriver.getConnection(); 
					Statement st2=con2.createStatement();
					System.out.println("After Statement");
					ResultSet rs2=st2.executeQuery("select * from semister_master");
					while(rs2.next())
					{
		%>
						<option value="<%=rs2.getString(1)%>"><%=rs2.getString(2)%></option>
		<%
					}
					st2.close();
					con2.close();
		%>
          </select></td>
      </tr>
      <tr>
        <td width="50%">Subject ID</td>
        <td width="50%"><select size="1" name="subid" tabindex="5">
		<%
					System.out.println("ss");
					Connection con3=MySQLDriver.getConnection(); 
					Statement st3=con3.createStatement();
					System.out.println("After Statement");
					ResultSet rs3=st3.executeQuery("select * from subject_master");
					while(rs3.next())
					{
		%>
						<option value="<%=rs3.getString(1)%>"><%=rs3.getString(2)%></option>
		<%
					}
					st3.close();
					con3.close();
		%>
          </select></td>
      </tr>
      <tr>
        <td width="50%">Exam Starting Date</td>
        <td width="50%"><input type="text" name="exstart" size="20" tabindex="6"></td>
      </tr>
      <tr>
        <td width="50%">Exam Ending Date</td>
        <td width="50%"><input type="text" name="exend" size="20" tabindex="7"></td>
      </tr>
      <tr>
        <td width="50%">Exam Fee</td>
        <td width="50%"><input type="text" name="exfee" size="20" tabindex="8"></td>
      </tr>
      <tr>
        <td width="100%" colspan="2">
          <p align="center"><input type="submit" value="Insert" name="action" tabindex="9"></td>
      </tr>
    </table>
    </center>
  </div>
</form>

</body>

</html>
